Skip to content

update rust-cdm contract tests#116

Merged
charlesHetterich merged 20 commits into
mainfrom
ch/cdm-e2e
May 6, 2026
Merged

update rust-cdm contract tests#116
charlesHetterich merged 20 commits into
mainfrom
ch/cdm-e2e

Conversation

@charlesHetterich

@charlesHetterich charlesHetterich commented May 4, 2026

Copy link
Copy Markdown
Collaborator

Closes #108.

Summary

This PR restores CDM/PVM deploy coverage in the PR E2E matrix and updates the deploy dependencies needed for that path to run.

What changed

  • Replaces the old rust-cdm stub fixture with a real CDM Rust workspace containing counter, counter-reader, and counter-writer.
  • Adds the Rust/CDM project files and committed target/*.release.polkavm artifacts used by the E2E deploy.
  • Un-skips the CDM deploy test and runs it with --no-contract-build, matching the foundry/hardhat E2E pattern of deploying prebuilt artifacts.
  • Adds pr-deploy-cdm back to the test-publish matrix and runs it first so failures surface earlier.
  • Installs the Rust/CDM prerequisites only for the CDM matrix cell, because the skip-build path still uses detectContracts(), which calls cargo metadata.
  • Updates E2E DotNS domains to PopLite-compatible labels like e2ecdm00.
  • Updates bulletin-deploy to 0.7.10 for the DotNS/deploy fixes needed by this flow.
  • Fixes local/CI E2E helpers so isolated homes, pnpm, Rust paths, and dot-runs.log behave consistently.

Verification

pnpm format:check
pnpm exec vitest run src/utils/deploy/contracts.test.ts
pnpm build

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Dev build ready — try this branch:

curl -fsSL https://raw.githubusercontent.com/paritytech/playground-cli/main/install.sh | VERSION=dev/ch/cdm-e2e bash

@socket-security

socket-security Bot commented May 4, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​bulletin-deploy@​0.7.6 ⏵ 0.7.1071 +1100100 +196 +1100
Updatednpm/​@​parity/​dotns-cli@​0.5.6 ⏵ 0.6.07410010096 +1100
Addedcargo/​parity-scale-codec@​3.7.58310093100100
Addedcargo/​polkavm-derive@​0.30.010010093100100
Addedcargo/​polkavm-derive@​0.31.010010093100100
Addedcargo/​picoalloc@​5.2.010010098100100

View full report

@charlesHetterich charlesHetterich changed the title Ch/cdm e2e update rust-cdm contract tests May 4, 2026
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

E2E Test Pass · ✅ PASS

Tag: e2e-ci-pr · Branch: ch/cdm-e2e · Commit: 60673a8 · Run logs

Cell Result Time
pr-preflight ✅ PASS 2m21s
pr-deploy-foundry ✅ PASS 1m43s
pr-init-session ✅ PASS 1m48s
pr-deploy-cdm ✅ PASS 4m25s
pr-mod ✅ PASS 1m24s
pr-install ✅ PASS 0m48s
pr-deploy-frontend ✅ PASS 5m36s
${{ matrix.cell }} ⏭️ SKIP 0m-1s
${{ matrix.cell }} ⏭️ SKIP 0m-1s

Sentry traces: view spans for this run

charlesHetterich and others added 4 commits May 4, 2026 13:12
PolkaVM uses a custom JSON target spec which requires the nightly
-Zjson-target-spec feature — stable rejects it outright. Switch the
install-rust-pvm CI step from stable to nightly, set nightly as default
so cargo-pvm-contract picks it up, and add rust-toolchain.toml to the
fixture so local builds self-configure.
…cal runner

Without a skipIf guard the CDM describe block runs in every local mode
(smoke/pr/nightly) and fails immediately on machines that don't have the
nightly Rust toolchain + cargo-pvm-contract installed. Add a module-level
hasCargoPvmContract() probe and gate the describe block on it — CI always
installs the tool so the test runs there, local runs without it skip
cleanly. Also add a warning to tools/e2e-local.sh alongside the existing
ipfs check so developers know why the cell is skipped and how to install.
@EnderOfWorlds007

Copy link
Copy Markdown
Collaborator

Current state + what's needed next

Agreed approach: Path A (same pattern as foundry/hardhat)

Foundry and hardhat E2E tests never exercise the full compilation chain — they always use --no-contract-build with pre-built artifacts committed to the repo. CDM should do the same.

What the PR does today (Path B — to be replaced):

  • Installs nightly Rust + cargo-pvm-contract in CI (installRustPvm: true step)
  • Builds contracts from source on every CI run
  • ~5 min toolchain install overhead per cell run

What it should do (Path A):

  • Pre-built .polkavm artifacts committed to e2e/cli/fixtures/projects/rust-cdm/target/
  • Test uses --no-contract-build (same as runContractDeployTest for foundry/hardhat)
  • No toolchain install step in the CI workflow at all
  • pr-deploy-cdm cell stays in test-publish matrix, no installRustPvm

Blocker: need the pre-built artifacts committed. Steps:

cd e2e/cli/fixtures/projects/rust-cdm
cargo pvm-contract build --release   # requires nightly + cargo-pvm-contract
# commit the resulting target/<crate>.release.polkavm files

Once artifacts are committed, I'll:

  1. Switch the CDM test to --no-contract-build (matching runContractDeployTest)
  2. Remove the installRustPvm matrix key and toolchain install step from the workflow
  3. Drop the hasCargoPvmContract() skip guard (no longer needed — test works without toolchain)
  4. Drop rust-toolchain.toml from the fixture (no longer needed)

Match the foundry/hardhat deploy cells by running the CDM deploy test with --no-contract-build against committed PolkaVM artifacts. This removes the CI dependency on rustup, nightly Rust, cargo-pvm-contract, and a system C linker while still exercising CDM contract deployment end-to-end.
Skip-build CDM deploys now scan target/*.release.polkavm directly instead of calling detectContracts(), which shells out to cargo metadata. This keeps the E2E Path A setup independent of Cargo while preserving the real contract deployment path.
Move pr-deploy-cdm to the top of the serial publish E2E matrix so CDM failures surface before the slower frontend/foundry deploy cells.
Restore the semantic CDM skip-build path through detectContracts(), and make the pr-deploy-cdm E2E cell install the Rust/CDM prerequisites it needs for cargo metadata. The deploy still uses --no-contract-build with committed PolkaVM artifacts.
The CDM installer writes cdm to ~/.cdm/bin and updates shell startup files, but the current GitHub Actions shell does not reload those files. Add the path explicitly before verifying cdm and running the deploy cell.
@charlesHetterich charlesHetterich merged commit 48c3853 into main May 6, 2026
19 checks passed
@charlesHetterich charlesHetterich deleted the ch/cdm-e2e branch May 14, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E2E Phase 5f — rust-cdm fixture upgrade + re-add pr-deploy-cdm cell

2 participants